<div class="page-header">
    <h5 class="content-title"><%= __('distributor.CDManagement') %></h5>
    <div class="pull-left">
        <ul class="fl">
            <li>
                <button class="btn btn-block btn-info newAccount"><i class="fui-plus-circle icon-menu"></i></i>
                    <span><%= __('tenant.ECDistributor') %></span>
                </button>
            </li>
            <li>
                <button class="btn btn-block btn-primary vendorCustomer"><i class="fa fa-briefcase icon-menu"></i></i>
                    <span><%= __('tenant.relevantClient') %></span>
                </button>
            </li>
            <li>
                <button class="btn btn-block btn-success vendorAccount"><i class="fa fa-user-circle-o icon-menu"></i></i>
                    <span><%= __('tenant.CACorrelation') %></span>
                </button>
            </li>
        </ul>
    </div>
</div>
<div class="queryCondition">
    <form class="query-form">
        <div class="row">
            <div class="col-md-3">
                <label><%= __('tenant.CDName') %>：</label>
                <input type="text" name="name_like" placeholder="<%= __('account.fuzzySearchByName') %>">
            </div>
            <div class="col-md-3">
                <label><%= __('tenant.CDCode') %>：</label>
                <input type="text" name="code_like" placeholder="<%= __('account.fuzzySearchByCode') %>">
            </div>
            <div class="col-md-3">
                <label><%= __('framework.cellphoneNumber') %>：</label>
                <input type="text" name="mobile_like" placeholder="<%= __('account.fuzzySearchByCellphone') %>">
            </div>
        </div>
        <div class="row">
            <div class="col-md-2">
                <input type="hidden" id="_loginCustomerId" value="<%= session.userData.customerId %>" />
                <input type="hidden" id="_loginAccountId" value="<%= session.userData.userId%>" />
                <button type="button" class="btn btn-sm btn-inverse btn-query"><%= __('account.search') %></button>
            </div>
        </div>
    </form>
</div>

<div class="dolphin-col-24 main" id="myContent">
    <div class="row">
        <div class="dolphin-col-14">
            <div class="panel panel-primary box">
                <div class="panel-heading box-title">
                    <h3 class="panel-title">
                        <i class="fa fa-table fa-lg" aria-hidden="true"></i>
                        <%= __('tenant.CDList') %>
                    </h3>
                    <div class="actions">
                        <a class="btn btn-mini content-refresh" href="#">
                            <i class="fa fa-refresh"></i>
                        </a>
                    </div>
                </div>
                <div id="userList" class="box-content"></div>
            </div>
        </div>
        <div class="dolphin-col-10">
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">
                        <%= __('distributor.channelCustomers') %>
                    </a></li>
                <li role="presentation"><a href="#profile" role="tab" data-toggle="tab"><%= __('distributor.associatedAccount') %></a></li>
            </ul>
            <!-- Tab panes -->
            <div class="tab-content" style="padding-top: 10px;">
                <div role="tabpanel" class="tab-pane active" id="home">
                    <div id="customerList"></div>
                </div>
                <div role="tabpanel" class="tab-pane" id="profile">
                    <div id="accountList"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal" id="account_win">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <span class="modal-title"><%= __('distributor.CDMaintanence') %></span>
            </div>
            <div class="modal-body">
                <div class="tab-pane">
                    <form class="form-horizontal edit-form">
                        <input type="hidden" class="form-control" name="id">
                        <input type="hidden" name="type" value="1">
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('tenant.CDName') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="name" type="text" dol-validate="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('tenant.CDCode') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="code" type="text" dol-validate="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('framework.contactPerson') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="contactPerson" type="text" dol-validate="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('framework.telephone') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="mobile" type="text" dol-validate="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('framework.email') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="email" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('framework.address') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="address" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('framework.basicRebate') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="profit" type="number">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary btn_submit"><%= __('account.save') %></button>
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('account.delete') %></button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>

<div class="modal" id="customer_win">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <span class="modal-title"><%= __('tenant.relevantClient') %></span>
            </div>
            <div class="modal-body">
                <div class="tab-pane">
                    <form class="form-horizontal cus-form">
                        <input type="hidden" class="form-control" name="vendor.id">
                        <!--<input type="hidden" class="form-control" id="customerId" name="customer.id">-->
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('frameworkType.client') %></label>
                            <div class="col-md-6">
                                    <select id="cusCode" style="width:100%" name="customer.id"
                                            class="js-example-basic-single"></select>
                                    <!--<select id="cusCode" class="form-control"
                                            options
                                            optionUrl="/api/742445c653654caaa4a1fa69eb651a9a"
                                            ajaxType="post"
                                            optionParam='{"properties":{"category_in":"1"}}'
                                            codeField="id" nameField="name" name="customer.id"></select>-->
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-offset-1 col-md-2 control-label"><%= __('distributor.rebate') %></label>
                            <div class="col-md-6">
                                <input class="form-control" name="profit" type="number">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary cus_submit"><%= __('account.save') %></button>
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('account.delete') %></button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>

<div class="modal" id="org_relation_win">
    <div class="modal-dialog" style="width: 70%;left: 20%;top: 5%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <span class="modal-title"><%= __('distributor.OPMaintanence') %></span>
            </div>
            <div class="modal-body">
                <div class="dolphin-row">
                    <div class="dolphin-col-9">
                        <div id="selectedList"></div>
                    </div>
                    <div class="dolphin-col-3" style="margin-top: 50px;">
                        <button class="btn btn-info btn-block selectbtn" change="select" all="true">&lt;&lt;</button>
                        <button class="btn btn-info btn-block selectbtn" change="select">&lt;</button>
                        <br/><br/>
                        <button class="btn btn-success btn-block selectbtn" change="unSelect">&gt;</button>
                        <button class="btn btn-success btn-block selectbtn" change="unSelect" all="true">
                            &gt;&gt;</button>
                    </div>
                    <div class="dolphin-col-12">
                        <div id="unselectedList"></div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary relation_submit"><%= __('account.save') %></button>
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('account.delete') %></button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
</div>

<script src="<%= global.config.publicPath %>/bootstrap/bootstrap-suggest.js"></script>
<script src="<%= global.config.publicPath %>/page/scripts/<%= path %>.js"></script>